package demo;

import java.util.Arrays;

public class Demo_01 {
    public static void main(String[] args) {
        //创建一个学生数组,数组中存放5个学生对象信息
        Student [] arr = new Student[3];
        arr[0] = new Student("张三",19);
        arr[1] = new Student("李四",19);
        arr[2] = new Student("王五",19);
        System.out.println(Arrays.toString(arr));


        for (int i = 0; i < arr.length; i++) {
            arr[i].show();//NullPointerException空指针异常
        }
    }
}
